package com.jlsoft.web.cmn;

import com.jlsoft.config.SimpleResponse;
import com.jlsoft.entity.Permission;
import com.jlsoft.web.cmn.service.IMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/menu")
public class MenuController {

    @GetMapping("/")
    public SimpleResponse getMenus() {
        return new SimpleResponse(0, menuService.getMenuList(), true);
    }

    @PostMapping("/update/")
    public SimpleResponse updateMenus(Permission permission) {

        return menuService.updatePermisson(permission);
    }

    @Autowired
    private IMenuService menuService;
}
